package com.hyz.mapper;

import com.hyz.pojo.Authentication;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AuthenticationMapper {
    @Select("SELECT `username`,`password`,rights_id FROM `tb_user` u,tb_user_rights ur" +
            " WHERE u.id=ur.user_id " +
            "AND username=#{username} " +
            "AND password =#{password} " +
            "AND rights_id = #{rightsId} ")
    List<Authentication> getAuthentication(@Param("username")String username,
                                           @Param("password")String password,
                                           @Param("rightsId")Long rightsId);
}
